package com.dz.lm.domain.moneybar;

import java.util.List;

public class AgentNode {
	
	private Integer userId;
	private String profile;
	private String loginName;
	private Integer orderCount;
	private String agentClass;
	private String orgAuthFlag;
	private String parentAgentId;
	private String state;
	private Integer agentProductId;
	private Integer productId;
	private Integer originalProductId;
	private String barId;	
	private List<AgentNode> children;

	public AgentNode() {
	}

	public AgentNode(Integer userId, String profile, String loginName, Integer orderCount, String agentClass,
			String orgAuthFlag, String parentAgentId, String state, Integer productId, Integer agentProductId, Integer originalProductId,
			String barId, List<AgentNode> children) {
		super();
		this.userId = userId;
		this.profile = profile;
		this.loginName = loginName;
		this.orderCount = orderCount;
		this.agentClass = agentClass;
		this.orgAuthFlag = orgAuthFlag;
		this.parentAgentId = parentAgentId;
		this.state = state;
		this.agentProductId = agentProductId;
		this.originalProductId = originalProductId;
		this.barId = barId;
		this.children = children;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public Integer getOrderCount() {
		return orderCount;
	}

	public void setOrderCount(Integer orderCount) {
		this.orderCount = orderCount;
	}

	public String getAgentClass() {
		return agentClass;
	}

	public void setAgentClass(String agentClass) {
		this.agentClass = agentClass;
	}

	public String getOrgAuthFlag() {
		return orgAuthFlag;
	}

	public void setOrgAuthFlag(String orgAuthFlag) {
		this.orgAuthFlag = orgAuthFlag;
	}

	public String getParentAgentId() {
		return parentAgentId;
	}

	public void setParentAgentId(String parentAgentId) {
		this.parentAgentId = parentAgentId;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	public Integer getAgentProductId() {
		return agentProductId;
	}

	public void setAgentProductId(Integer agentProductId) {
		this.agentProductId = agentProductId;
	}

	public Integer getOriginalProductId() {
		return originalProductId;
	}

	public void setOriginalProductId(Integer originalProductId) {
		this.originalProductId = originalProductId;
	}

	public String getBarId() {
		return barId;
	}

	public void setBarId(String barId) {
		this.barId = barId;
	}

	public List<AgentNode> getChildren() {
		return children;
	}

	public void setChildren(List<AgentNode> children) {
		this.children = children;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((agentClass == null) ? 0 : agentClass.hashCode());
		result = prime * result + ((agentProductId == null) ? 0 : agentProductId.hashCode());
		result = prime * result + ((barId == null) ? 0 : barId.hashCode());
		result = prime * result + ((productId == null) ? 0 : productId.hashCode());
		result = prime * result + ((originalProductId == null) ? 0 : originalProductId.hashCode());
		result = prime * result + ((parentAgentId == null) ? 0 : parentAgentId.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AgentNode other = (AgentNode) obj;
		if (agentClass == null) {
			if (other.agentClass != null)
				return false;
		} else if (!agentClass.equals(other.agentClass))
			return false;
		if (productId == null) {
			if (other.productId != null)
				return false;
		} else if (!productId.equals(other.productId))
			return false;
		if (agentProductId == null) {
			if (other.agentProductId != null)
				return false;
		} else if (!agentProductId.equals(other.agentProductId))
			return false;
		if (barId == null) {
			if (other.barId != null)
				return false;
		} else if (!barId.equals(other.barId))
			return false;
		if (originalProductId == null) {
			if (other.originalProductId != null)
				return false;
		} else if (!originalProductId.equals(other.originalProductId))
			return false;
		if (parentAgentId == null) {
			if (other.parentAgentId != null)
				return false;
		} else if (!parentAgentId.equals(other.parentAgentId))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}
}